<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Product Profile</title>
    <link rel="stylesheet" type="text/css" href="<s:url value='/CSS/product/product_select.css'/>"/>
  </head>
  <body>
    <div class="container">
      <div class="head">
        <s:include value="/WEB-INF/JSP/head.jsp"/>
      </div>
      <div class="body">
        <div class="left">
          <s:include value="/WEB-INF/JSP/left.jsp"></s:include>
        </div>
        <div class="right">
          <s:push value="product">
            <div class="title">Product Profile</div>
            <div class="content">
              <div class="figure">
               <s:set var="context_path" value="#request.get('javax.servlet.forward.context_path')"></s:set>
                <s:a action="productAction_select" namespace="/product">
                  <s:param name="product.productId" value="productId"/>
                  <img class="img" src="${context_path}/upload/<s:property value='uploadFile.filePath'/>" alt="<s:property value='uploadFile.filePath'/>"/>
                </s:a>   
              </div>  
              <div class="profile">
                <div class="item">
                  <div class="label">Product Name:</div>
                  <div class="field">
                    <s:a action="productAction_select" namespace="/product">
                      <s:param name="product.productId" value="productId"/>
                      <s:property value="name"/>   
                    </s:a>
                  </div>
                </div>
                <div class="item">
                  <div class="label">Market Price:</div>
                  <div class="field"><s:property value="marketPrice"/></div>
                </div>
                <div class="item">
                  <div class="label">Market Price Difference:</div>
                  <div class="field">
                    <s:property value="salesPrice"/>
                    <s:if test="salesPrice < marketPrice">
                      (Saving:<b><s:property value="marketPrice - salesPrice"/></b>)
                    </s:if>
                  </div>
                </div>
                <div class="buy-now">
                  <s:a action="cartAction_add" namespace="/cart">
                    <s:param name="productId" value="productId"/>Buy Now
                  </s:a>                    
                </div>
              </div>
            </div>
            <div class="description"><s:property value="description"/></div>
          </s:push>
        </div>
      </div>
      <div class="foot">
        <s:include value="/WEB-INF/JSP/foot.jsp"></s:include>
      </div>
    </div>
  </body>
</html>